/*
 * Copyright (c) 2024. hallele, Inc All rights reserved.
 */

package cn.hallele.ms.portalcenter.domain.action.tenant;

import cn.hallele.ms.portalcenter.domain.das.TenantDDDas;
import cn.hallele.ms.portalcenter.domain.domain.TenantDomain;
import jakarta.validation.constraints.NotEmpty;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * hallele_ms_portalcenter
 *
 * @author anle5
 * @since 2024/10/13 20:46
 */
@Slf4j
@Service
public class TenantDomainService {
    @Autowired
    private TenantDDDas tenantDDDas;

    /**
     * 获取 租户列表
     *
     * @param condition 查询条件
     * @return List
     */
    public List<TenantDomain> findAll(TenantDomain condition) {
        return this.tenantDDDas.findAll(condition);
    }

    /**
     * 获取 租户列表
     *
     * @param condition 查询条件
     * @return List
     */
    public List<TenantDomain> findAllMoreCondition(TenantDomain condition) {
        return tenantDDDas.findAllMoreCondition(condition);
    }

    /**
     * 添加租户
     *
     * @param tenantDomain tenantDomain
     */
    public void addTenant(TenantDomain tenantDomain) {
        this.tenantDDDas.addTenant(tenantDomain);
    }

    /**
     * 修改租户
     *
     * @param tenantDomain tenantDomain
     */
    public void updateTenant(TenantDomain tenantDomain) {
        this.tenantDDDas.updateTenant(tenantDomain);
    }

    /**
     * 获取租户详情
     *
     * @param id id
     * @return TenantDomain
     */
    public TenantDomain getTenant(Integer id) {
        return this.tenantDDDas.getTenant(id);
    }

    /**
     * 删除租户
     *
     * @param ids ids
     */
    public void deleteTenant(@NotEmpty List<Integer> ids) {
        this.tenantDDDas.deleteTenant(ids);
    }
}
